<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>

<html>

 <head>
    
    <title>单位管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>

		<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/basic/fundamentalUnit";
		var basic_WUrl="yd/basic/fundamentalUnit";
		var basic_Title="添加功能";
		var show_Width=520;
		var show_Hight=300;
		function createSearch(){
			init(1,8,'140,140,140,140','25%');

			//第一行的数据
			addCommon(0,0,"lable","名称：");
			addCommon(0,1,"txtlike","unitname");
			addCommon(0,2,"lable","编码：");
			addCommon(0,3,"txtlike","unitcode");
		}
		function searchAP(){			
			multipleSearch("#table1",true,"",basic_Url+"/list.do");
		}
		 function getSelected(){
			 var grid = $("#table1").ligerGetGridManager(); 
				var rows = grid.getCheckedRows();
				if(rows.length==0){
					$.dialog.alert("请选择一行数据!");
					return null;
				}else{
					return rows[0];
				}
			}
		 
		 $(function(){
			//创建JQGRID表格
				var grid = $("#table1").ligerGrid({
			        columns: [
			                  { display: '单位名称', name: 'unitname', width: 200 },
			                  { display: '单位编码', name: 'unitcode', width: 200 },
// 			                  { display: '换算率', name: 'unitconvert', width: 160},
			                  { display: '创建人', name: 'dcruser', width: 200},
			                  { display: '创建时间', name: 'dctime', width: 200,
			                	  render: function (item){
			                		  if(item.dctime != null && item.dctime !=""){
			                			  var cdate=new Date(item.dctime);
				                		  return formatDate(cdate,"yyyy-MM-dd");
			                			 }
			                		  return "";
			                	  }
			                  },
			                  { display: '备注', name: 'remark', width: 200 }
			                      ],  usePager: true,pageSize:15,
			                      url : basic_Url+"/list.do",enabledSort :false,
			                      width: '100%', height: '98%',pageSizeOptions :[15,25,35], checkbox: true,rownumbers:true,           
			                      onDblClickRow : function (data, rowindex, rowobj){
			                          edit(data);
			                       }
			                  });
				$("#pageloading").hide();
		 });
	</script>
  </head>
<body onLoad="createSearch()">
   <div id="layout1">
          <div class="panelBar">
	            <ul class="toolBar">
		           <li><a class="add" onclick="add()">
		           <span>添加</span></a></li>
				   <li><a class="delete" onclick="del()"><span>删除</span></a></li>
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
 
</body>
</html>